﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArbolandiaBL
{
    internal abstract class ErrorExceptionBase
    {
        private readonly ObError _obError;

        internal ObError ObError
        {
            get { return _obError; }
        }

        internal virtual void FillErrorObj(Exception ex, string comments, int idUser)
        {
            _obError.Comments = comments;
            _obError.IdUser = idUser;
            _obError.ErrorMessage = ex.Message;
            _obError.Date = DateTime.Now;
            _obError.InnerExeptionMessage = ex.InnerException != null ? ex.InnerException.Message : "";
            _obError.Source = ex.Source;
            _obError.StackTrace = ex.StackTrace;
        }
    }
}
